package cn.tedu.charging.cost.dao.impl;


import cn.tedu.charging.cost.dao.mapper.ChargingGunInfoPOMapper;
import cn.tedu.charging.cost.dao.repository.ChargingGunInfoRepository;
import cn.tedu.charging.cost.entity.po.ChargingGunInfoPO;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository
public class ChargingGunInfoRepositoryImpl implements ChargingGunInfoRepository {
    @Autowired
    private ChargingGunInfoPOMapper chargingGunInfoPOMapper;

    @Override
    public Integer getGunType(Integer gunId) {
        QueryWrapper<ChargingGunInfoPO> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("id",gunId);
        ChargingGunInfoPO chargingGunInfoPO = chargingGunInfoPOMapper.selectOne(queryWrapper);
        if (chargingGunInfoPO==null)
            return null;
        return chargingGunInfoPO.getGunType();
    }
}
